﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="New_Add.aspx.cs" Inherits="Manage_New_Add"   ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
    #new_add_table{ width:99%;border-collapse:collapse; empty-cells:show; margin-left:8px; margin-top:10px; margin-bottom:20px;}
    #new_add_table tr{ height:35px;background:#f6f6f6;}
    #new_add_table tr td{ border:#d8d8d8 1px solid; vertical-align:middle;}
    #new_add_table tr .td1{ width:110px; text-align:right; padding-right:15px;}
    #new_add_table tr .td2{ padding-left:10px;}
    #frb tr{ height:auto;}
    #frb tr td{ border:0px; }
    #resize_edit{float:right; display:inline-block;}
    #resize_edit a{ margin-right:10px;}
    .insert_fp{ margin-left:50px; margin-right:50px;}
    .insert_fp img{ margin-bottom:-5px;}
    
</style>
<%if (false)  { %>
       <script src="../Ueditor/ueditor.all.js" type="text/javascript"></script>
    <% } %>
<script src='<%=ResolveUrl("~/Ueditor/ueditor.config.js")%>' type="text/javascript"></script>
<script src='<%=ResolveUrl("~/Ueditor/ueditor.all.min.js")%>' type="text/javascript"></script>
<script type="text/javascript">
    var ue;
    jQuery(document).ready(
        function () {
            ue = UE.getEditor('Ueditor', {
                initialFrameWidth: 650,
                initialFrameHeight: 300
            });
            ue.addListener('contentChange', function (editor) {
                jQuery("[id$=contents]").val(ue.getContent());
                jQuery("[id$=contents_text]").val(ue.getContentTxt());
            });
            

            /*--------旧编辑器部分,注释掉不使用---------*/
            //            var ftb_contents = jQuery('#<%=contents.ClientID %>');
            //            var ftb_contents_Editor = jQuery('#<%=contents.ClientID+"_designEditor" %>');
            //            jQuery("#raise").click(
            //                function () {
            //                    ftb_contents.css("height", ftb_contents.height() + 100 + "px");
            //                    ftb_contents_Editor.css("height", ftb_contents_Editor.height() + 100 + "px");
            //                }
            //            );
            //            jQuery("#Narrow").click(
            //                function () {

            //                    if (ftb_contents.height() > 300) {
            //                        ftb_contents.css("height", ftb_contents.height() - 100 + "px");
            //                    }
            //                    if (ftb_contents_Editor.height() > 300) {
            //                        ftb_contents_Editor.css("height", ftb_contents_Editor.height() - 100 + "px");
            //                    }
            //                }
            //            );
            /*--------旧编辑器部分,注释掉不使用---------*/
        }
    );
    var insertImg = function (img) {
        ue.setContent(img, true);
    }
    var insertFile = function (file) {
        ue.setContent(file, true);
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>  
<table id="new_add_table">
   <tr style=" height:25px; background:url('images/tt_x.gif') repeat-x;">
     <td colspan="2" style=" padding-left:8px;">添加网站信息
     </td>
   </tr>

   <tr>
     <td class="td1">信息标题: 
     </td>
     <td class="td2">
         <asp:TextBox ID="title" runat="server"></asp:TextBox>
         <asp:CheckBox ID="shenhe" runat="server"  Text="审核" style=" margin-left:30px;"/>
         <asp:CheckBox ID="istop" runat="server"  Text="置顶" style=" margin-left:30px;"/>
     </td>
   </tr>
   <tr>
     <td class="td1">所属分类:
     </td>
     <td class="td2">
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
              <asp:DropDownList ID="bigclassid" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="bigclassid_SelectedIndexChanged" >
              </asp:DropDownList>
              <asp:Label ID="testbig" runat="server" Text="*" ForeColor="Red" Style="width:100px;"></asp:Label>
              <asp:DropDownList ID="smallclassid" runat="server"  Visible="false">
                    <asp:ListItem Value="0">--请选择小类--</asp:ListItem>
              </asp:DropDownList>
              <asp:Label ID="testsmall" runat="server" Text="*" ForeColor="Red"></asp:Label>
         </ContentTemplate>
       </asp:UpdatePanel>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <img alt="加载" src="images/loading03.gif" />读取数据...
            </ProgressTemplate>
       </asp:UpdateProgress>
     </td>
   </tr>
   <tr>
     <td class="td1">文章编辑:
     </td>
     <td class="td2">
         <asp:TextBox ID="author" runat="server"></asp:TextBox>
         <asp:Panel ID="HDTime_panel" runat="server" style=" margin-left:100px; display:inline-block;">
            活动时间:
            <asp:TextBox ID="HDTime_tb" runat="server"></asp:TextBox>格式:(####年##月##日）
         </asp:Panel>
     </td>
   </tr>
   <tr>
     <td class="td1">文章内容:
     </td>
     <td class="td2">
       <div id="frb">
<%--       <FTB:FreeTextBox ID="contents" 
                     runat="server"
                     ImageGalleryPath = "~/Upload/newspic"  
                     ImageGalleryUrl="ImageHandler.aspx?path=Upload/newspic"
                     Language="zh-CN" 
                     Width="650px"
                     Height="300px" BackColor="White"
                    ToolbarLayout="FontFacesMenu,FontSizesMenu,FontForeColorsMenu,
                                   FontForeColorPicker,FontBackColorsMenu,FontBackColorPickerBold,
                                   Italic,Underline,Bold,Italic,
                                   JustifyLeft,JustifyRight,JustifyCenter,JustifyFull,
                                   Outdent,CreateLink,Unlink,InsertDate,
                                   InsertTime,InsertTable,InsertImageFromGallery,InsertImage">
        </FTB:FreeTextBox>--%>
        <asp:HiddenField ID="contents" runat="server" />
        <asp:HiddenField ID="contents_text" runat="server" />
        <script id="Ueditor" type="text/plain" name="Ueditor"></script>
        </div>
     </td>
   </tr>
   <tr>
     <td class="td1">
     </td>
     <td class="td2">
        <span id="resize_edit">
            <a href="javascript:void(0);" id="raise">+加大编辑器</a>
            <a href="javascript:void(0);" id="Narrow">-缩小编辑器</a>
        </span>
     </td >
   </tr>
   <tr>
     <td class="td1">添加附件:
     </td>
     <td class="td2">
         <a href='<%=ResolveUrl("~/Manage/ImageHandler.aspx?path=Upload/newspic&ftb=Ueditor") %>' class="insert_fp" target="_blank"><img alt="" src='<%=ResolveUrl("~/Manage/images/insertimage.gif") %>' />插入图片</a>
         <a href='<%=ResolveUrl("~/Manage/FileHandler.aspx?path=Upload/file&ftb=Ueditor") %>' target="_blank" class="insert_fp" ><img alt="" src='<%=ResolveUrl("~/Manage/images/attachment.gif") %>' />插入文件</a>
     </td>
   </tr>
   <tr>
     <td colspan="2" style=" text-align:right; padding-right:20px;">
         <asp:Button ID="Submit" runat="server" Text="确认添加" OnClick="Button1_Click" />
     </td>
   </tr>
</table>
</asp:Content>

